﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pipes.Queries.Model.Pattern
{
  public class StringMatch : IMatch
  {
    private StringBuilder _match;
    private Repetition _repeat = new Repetition();

    public StringBuilder Match 
    { 
      get
      {
        return _match;
      }
    }
    public Repetition Repeat 
    { 
      get
      {
        return _repeat;
      }
    }

    public StringMatch() : this("") { }
    public StringMatch(string value)
    {
      _match = new StringBuilder(value);
    }
    public StringMatch(char value)
    {
      _match = new StringBuilder(value);
    }

    public override string ToString()
    {
      return _match.ToString() + _repeat.ToString();
    }

    public void Visit(Parser.IPatternVisitor visitor)
    {
      visitor.Visit(this);
    }
    public bool ContentEquals(IMatch value)
    {
      return false;
    }
  }
}
